//
//  WhiteViewController.m
//  CustomTransition
//
//  Created by Xwoder on 17/1/31.
//  Copyright © 2017年 Xwoder. All rights reserved.
//

#import "WhiteViewController.h"
#import "OrangeViewController.h"
#import "TransitionAnimation.h"

@interface WhiteViewController () <UINavigationControllerDelegate>

@end

@implementation WhiteViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"White";
    self.navigationController.delegate = self;
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    OrangeViewController *orangeViewController = [[OrangeViewController alloc] init];
    [self.navigationController pushViewController:orangeViewController animated:YES];
}

#pragma mark - UINavigationControllerDelegate

- (id<UIViewControllerAnimatedTransitioning>)navigationController:(UINavigationController *)navigationController animationControllerForOperation:(UINavigationControllerOperation)operation fromViewController:(UIViewController *)fromVC toViewController:(UIViewController *)toVC {
    TransitionAnimation *animation = [[TransitionAnimation alloc] init];
    return animation;
}

@end
